{template 'header'}
<div class="m">
	<table cellpadding="0" cellspacing="0" width="100%">
		<tr>
			<td valign="top" class="left_menu">
				<ul>
					<li class="left_menu_li"><a href="{SITE_URL}">网站首页</a></li>
					<li class="left_menu_li" id="type_0"><a href="{url('extend/link')}">友情链接</a></li>
					{loop $TYPE $t}
					<li class="left_menu_li" id="type_{$t[typeid]}"><a href="{url('extend/link','typeid='.$t[typeid])}">{$t[typename]}</a></li>
					{/loop}
					<li class="left_menu_li" id="type_reg"><a href="{url('extend/link','action=reg')}">申请链接</a></li>
				</ul>
			</td>
			<td valign="top">
				<div class="left_box">
					{if $action == 'reg'}
					<div class="pos">当前位置: <a href="{SITE_URL}">首页</a> &raquo; <a href="{url('extend/link')}">友情链接</a> &raquo; <a href="{url('extend/link','action=reg')}">申请链接</a></div>
					<br/>
					<form method="post" action="{url('extend/link')}" id="dform" onsubmit="return check();">
						<input type="hidden" name="action" value="reg"/>
						<table cellpadding="6" cellspacing="1" width="96%" align="center" bgcolor="#E3EEF5">
							{if $MOD[link_request]}
							<tr bgcolor="#FFFFFF">
								<td bgcolor="#F1F7FC">链接说明</td>
								<td>{$MOD[link_request]}</td>
							</tr>
							{/if}
							<tr bgcolor="#FFFFFF">
								<td bgcolor="#F1F7FC" width="100">网站分类 <span class="f_red">*</span></td>
								<td>{$type_select} <span id="dtypeid" class="f_red"></span></td>
							</tr>
							<tr bgcolor="#FFFFFF">
								<td bgcolor="#F1F7FC">网站名称 <span class="f_red">*</span></td>
								<td><input name="post[title]" type="text" id="title" size="40" /> <span id="dtitle" class="f_red"></span></td>
							</tr>
							<tr bgcolor="#FFFFFF">
								<td bgcolor="#F1F7FC">网站地址 <span class="f_red">*</span></td>
								<td><input name="post[linkurl]" type="text" id="linkurl" size="40" value="http://"/> <span id="dlinkurl" class="f_red"></span></td>
							</tr>
							<tr bgcolor="#FFFFFF">
								<td bgcolor="#F1F7FC">网站LOGO</td>


								<td>{Post::picture(3, 'thumb', 'post[thumb]', $company_thumb ,500, 500)} <span id="dthumb" class="f_red"></span></td>
							</tr>
							<tr bgcolor="#FFFFFF">
								<td bgcolor="#F1F7FC">网站介绍</td>
								<td><textarea name="post[introduce]" style="width:300px;height:40px;"></textarea></td>
							</tr>
							<tr bgcolor="#FFFFFF">
								<td bgcolor="#F1F7FC">验证码 <span class="f_red">*</span></td>
								<td>{template 'captcha', 'chip'} <span id="dcaptcha" class="f_red"></span></td>
							</tr>
							<tr bgcolor="#FFFFFF">
								<td bgcolor="#F1F7FC"> </td>
								<td><input type="submit" name="submit" value=" 确定 " class="btn"/>&nbsp;&nbsp;<input type="reset" name="reset" value=" 重置 " class="btn"/></td>
							</tr>
						</table>
					</form>
					<br/>
					<script type="text/javascript">
						function check() {
							var l;
							var f;
							f = 'typeid';
							l = Dd(f).value;
							if(l == 0) {
								Dmsg('请选择分类', f);
								return false;
							}
							f = 'title';
							l = Dd(f).value.length;
							if(l < 2) {
								Dmsg('请输入网站名称', f);
								return false;
							}
							f = 'linkurl';
							l = Dd(f).value.length;
							if(l < 12) {
								Dmsg('请输入网站地址', f);
								return false;
							}
							f = 'captcha';
							l = Dd(f).value;
							if(!is_captcha(l)) {
								Dmsg('请填写验证码', f);
								return false;
							}
						}
						try{Dd('type_reg').className='left_menu_on';}catch(e){}
					</script>
					{else}
					<div class="pos"><span class="f_r f_b"><a href="{url('extend/link','action=reg')}">申请链接</a>&nbsp;&nbsp;&nbsp;&nbsp;</span>当前位置: <a href="{SITE_URL}">首页</a> &raquo; <a href="{url('extend/link')}">友情链接</a></div>
					<div style="padding:10px;">
						{if $typeid}
						<!--{Template::tag("table=link&condition=thumb!='' and status=3 and username='' and typeid=$typeid&areaid=$cityid&pagesize=1400&order=listorder desc,itemid desc&template=list-link&cols=7")}-->
						<div class="b10"></div>
						<!--{Template::tag("table=link&condition=thumb='' and status=3 and username='' and typeid=$typeid&areaid=$cityid&pagesize=1400&order=listorder desc,itemid desc&template=list-link&cols=7")}-->
						{else}
						<!--{Template::tag("table=link&condition=status=3 and thumb!='' and username=''&pagesize=1400&order=listorder desc,itemid desc&areaid=$cityid&template=list-link&cols=7")}-->
						<div class="b10"></div>
						<!--{Template::tag("table=link&condition=status=3 and thumb='' and username=''&pagesize=1400&order=listorder desc,itemid desc&areaid=$cityid&template=list-link&cols=7")}-->
						{/if}
					</div>
					<script type="text/javascript">try{Dd('type_{$typeid}').className='left_menu_on';}catch(e){}</script>
					{/if}
				</div>
			</td>
		</tr>
	</table>
</div>
{template 'footer'}